import request from "@/utils/request";
import {serverIp} from "../../public/config.js";
const API_BASE_URL = `http://${serverIp}:8081/jdyfy`;

/**
 * 会议预约相关API
 */

/**
 * 添加会议
 *
 */
export const addMeet = (form) =>{
    return request.post(`${API_BASE_URL}/meet/save` , form)
        .then(res => {
            return res;
        });
};

/**
 * 获取会议列表
 * @returns
 */
export const getMeetList = () =>{
    return request.get(`${API_BASE_URL}/meets`).then(res => {
        return res.data;
    })
};

/**
 * 获取会议列表根据状态
 * @param meetLoca
 * @param projectName
 * @param contactPerson
 * @param status
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const getMeetListBySome = (meetLoca,projectName,contactPerson,status) =>{
    return request.get(`${API_BASE_URL}/meetsBySome`,{
        params: {
            meetLoca,
            projectName,
            contactPerson,
            status
        }
    }).then(res => {
        return res.data;
    })
};


export const getMeetByProjectName = (projectName) =>{
    return request.get(`${API_BASE_URL}/meetByProjectName`,{params: { projectName }}).then(res => {
        return res.data;
    })
};